//
//  MineTableViewCell.m
//  News
//
//  Created by weige on 16/6/14.
//  Copyright © 2016年 weige. All rights reserved.
//

#import "MineTableViewCell.h"
#import "MineModl.h"
@interface MineTableViewCell()
{
    UIImageView *icoimage;
    UILabel *title;
    UIImageView *rightIco;
}
@end
@implementation MineTableViewCell
-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self=[super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        
        [self bulidCellUI];
    }
    return self;
}

-(void)bulidCellUI
{
    icoimage=[[UIImageView alloc]init];
    [self addSubview:icoimage];
    title=[[UILabel alloc]init];
    title.textColor=[UIColor blackColor];
    title.font=[UIFont systemFontOfSize:14];
    [title sizeToFit];
    [self addSubview:title];
    rightIco=[[UIImageView alloc]initWithImage:[UIImage imageNamed:@"icon_go"]];
    [self addSubview:rightIco];
}
-(void)layoutSubviews
{

    //NSLog(@"%f",title.frame.size.width);
    icoimage.frame=CGRectMake(10, 10, 30, 30);
    title.frame=CGRectMake(50, 16, ReceiptSize(title.text, 14).width, ReceiptSize(title.text, 14).height);
    rightIco.frame=CGRectMake(self.frame.size.width-20, 20, rightIco.frame.size.width, rightIco.frame.size.height);
}
-(void)setMine:(MineModl *)mine
{
   
    icoimage.image=[UIImage imageNamed: [mine valueForKeyPath:@"iconName"]];
   title.text= [mine valueForKeyPath:@"title"];
   // rightIco.image=[UIImage imageNamed:@"icon_go"];
    
}
@end
